What data types are you using char arrays or the string class?
You cannot test char arrays like this. You need a 2D char array and strcmp.Code:#include <iostream> #include <string> using namespace std; int main() { string s2[] = { "test", "testing", "tested" }; for(int i=0; i < 3; i++) if("test" == s2[i]) cout << "26" << endl; else cout << s2[i] << endl; return 0; }